import parole
from parole.colornames import colors
from parole.display import interpolateRGB
import pygame, random

import sim, main, util, sim_items
from util import *

class DawnSword(sim_items.Weapon, sim_items.LightSource):
    def __init__(self):
        bonuses = {
                'hitMod': +1,
                'damageSkewMod': +1,
        }

        # TODO: depth, materials, etc.
        sim_items.Weapon.__init__(self, 
                'dawn sword',  # base name
                parole.map.AsciiTile(')', colors['GoldenRod']), # symbol
                9, # weight
                1100, # wield energy
                1200, # attack energy
                50, # maximum damage. a wielder with avg stats will average half
                    # this much damage
                bonuses,
                'slash', # verb
                False,   # startsVowel
                projectileDamage=30)

        sim_items.LightSource.__init__(self,
                'dawn sword',     #name
                50,     # layer
                parole.map.AsciiTile(')', colors['GoldenRod']),
                9,  # weight
                7000,   # light energy
                colors[random.choice(['DarkRed', 'IndianRed', 'FireBrick', 'Tomato'])],  # light color
                4.0,    # light intensity
                120000*60000,  # burn time
                showBurnTime=False,
                dousable=False,
                litAdjective="blazing",
                handsNeeded=0, # already takes a hand to ready as shield
                unidDescription="A celestial blade that blazes with the warmth of the rising sun.")

        self.snuffable = False
        self.startIntensity = self.lightIntensity
        self.startBurnTime = self.burnTime
        main.schedule.add(sim.Event('activate light', main.schedule.time,
            (self,), dests=[self]))
        self.fading = False

    def listen(self, event):
        sim_items.Weapon.listen(self, event)
        sim_items.LightSource.listen(self, event, superListen=False)

#========================================
thingClass = DawnSword

